package dal;

import java.sql.*;
import java.util.*;

public class ConnectionProvider {

	// TODO : imlement TRANSACTION

	// private Connection _conn = null;

	public static Connection genConnection() throws SQLException,
			ClassNotFoundException {

		// TODO : load DB info from config file

		Class.forName("org.postgresql.Driver");
		String url = "jdbc:postgresql://localhost:5432/Buzz";
		Properties props = new Properties();
		props.setProperty("user", "postgres");
		props.setProperty("password", "admin");
		// props.setProperty("ssl","true");
		Connection dbConn = DriverManager.getConnection(url, props);
		return dbConn;
	}

	private boolean inTrasaction = false;

	public boolean getInTransaction() {
		return inTrasaction;
	}

	public void StartTransaction() {

	}

	public void CommitTransaction() {

	}

	public void RollCommitTransaction() {

	}

	public static void ReleaseConnection(Connection conn) {

	}

}
